package com.atguigu.bigdata.scala.mytest.chapter02

import java.io.{ObjectOutputStream, OutputStream}
import java.net.Socket

import com.atguigu.bigdata.scala.bean.User

object Net_Master_Object {
  def main(args: Array[String]): Unit = {
    val socket: Socket = new Socket("localhost",8888)
    val stream: OutputStream = socket.getOutputStream
    val outputStream = new ObjectOutputStream(stream)
    val user: User = new User()
    outputStream.writeObject(user)
    outputStream.flush()
    outputStream.close()
    socket.close()
  }
}
